# Build the database

1. Download [Jena](https://jena.apache.org/download/#apache-jena):

        wget https://downloads.apache.org/jena/binaries/apache-jena-<version>.tar.gz
        tar xzf apache-jena-<version>.tar.gz

   Make sure `apache-jena-<version>/bin/` is in your `$PATH`.

2. Create the database (execute from the root of the repository):

        tdbloader --loc=dokk ./**/*.ttl

3. The database is ready to accept queries from the command line

        tdbquery --loc=dokk "SELECT DISTINCT ?subject WHERE {?subject ?predicate ?object}"

# More examples

Hint: if these queries are too long to be typed in the CLI, they can be saved
to a file and read like this: `tdbquery --loc=dokk --query=<file_name>`

1. Find all the keyboards that pass the double-shift nkro test:

        PREFIX : <dokk:nkro_test/>
        SELECT DISTINCT ?keeb
        WHERE {
            ?keeb :test [
                :result "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
            ]
        }

2. Is there any membrane keyboard that pass the double-shift test?

        PREFIX : <dokk:nkro_test/>
        ASK {
            ?keeb a :Keyboard;
                  :type "membrane";
                  :test [
                      :result "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
                  ]
        }

3. Shame membrane keebs:

        PREFIX : <dokk:nkro_test/>
        SELECT ?keeb ?type ?result {
            ?keeb a :Keyboard;
                  :type ?type;
                  :test [ :result ?result ] .
            FILTER(?result != "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG")
        }

4. List all Mimi&Eunice comics:

        PREFIX : <dokk:mimi_and_eunice/>
        SELECT ?n ?t
        WHERE {
            ?cs a :ComicStrip;
                :number ?n;
                :title ?t
        }
        ORDER BY ?n
